<template>
    <van-nav-bar left-text="返回" left-arrow @click-left="goback">
        <template #right>
            <van-icon name="search" size="18" />
        </template>
        <template #title>
            {{currentData.deviceName}}
        </template>
    </van-nav-bar>
    <router-view></router-view>
</template>

<script setup>
import { useStore } from 'vuex';
import { useRouter } from 'vue-router';
import {onMounted,reactive} from "vue";
const store = new useStore();
const router = new useRouter();

const currentData = reactive({
    data:[],
    deviceName: '',
    deviceID: ''
})

onMounted(()=> {
    console.log('AllCharts - mounted')
    // console.log(store.state.currentPage)                    //读取当前设备信息
    currentData.data = store.state.currentPage.deviceData
    currentData.deviceID = store.state.currentPage.DeviceID
    currentData.deviceName = store.state.currentPage.DeviceName
})

function goback(){
    router.go(-1);
}
</script>

<style scoped>

</style>